package vo;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;


/**
 * 商品：
 * 主键，编号，名称，价格，售卖时间，类别（包含单品和套餐），折扣，数量，备注，
 */
@Entity
public class Commodity implements Serializable{

	//使用序列自增长作为食品的唯一标识
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer commodityId;

	//食品编号
	private String commodityCode;

	//食品名称
	private String commodityName;
	
	//食品图片
	private String commodityPicture;
	
	//食品价格
	private String commodityPrice;
	
	//食品类型
	private String commodityType;
	
	//食品折扣
	private double commodityDiscount;
	
	//食品数量
	private int commodiryNum;
	
	//备注
	private String commodityTip;



	//多个食品对应一个商家
	@ManyToOne(optional=true,fetch=FetchType.EAGER)
	@JoinColumn(name="store_commodity_id" , nullable=false,updatable=false)
	private Store store;
	
	
	
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	

	public Integer getCommodityId() {
		return commodityId;
	}

	public void setCommodityId(Integer commodityId) {
		this.commodityId = commodityId;
	}

	public String getCommodityCode() {
		return commodityCode;
	}

	public void setCommodityCode(String commodityCode) {
		this.commodityCode = commodityCode;
	}

	public String getCommodityName() {
		return commodityName;
	}

	public void setCommodityName(String commodityName) {
		this.commodityName = commodityName;
	}

	public String getCommodityPrice() {
		return commodityPrice;
	}

	public void setCommodityPrice(String commodityPrice) {
		this.commodityPrice = commodityPrice;
	}

	public String getCommodityType() {
		return commodityType;
	}

	public void setCommodityType(String commodityType) {
		this.commodityType = commodityType;
	}

	
	
	public double getCommodityDiscount() {
		return commodityDiscount;
	}

	public void setCommodityDiscount(double commodityDiscount) {
		this.commodityDiscount = commodityDiscount;
	}

	public int getCommodiryNum() {
		return commodiryNum;
	}

	public void setCommodiryNum(int commodiryNum) {
		this.commodiryNum = commodiryNum;
	}

	public String getCommodityTip() {
		return commodityTip;
	}

	public void setCommodityTip(String commodityTip) {
		this.commodityTip = commodityTip;
	}

	public String getCommodityPicture() {
		return commodityPicture;
	}

	public void setCommodityPicture(String commodityPicture) {
		this.commodityPicture = commodityPicture;
	}

	
}